/*************************
MSG.h
*************************/
#ifndef _MSG_H
#define _MSG_H

typedef enum{   
	IDLE = 0, 
	ProcUartMsg,
	ProcPlcMsg,
	Wating_CTS,   
	Plc_Send,   
	Plc_Receving,   
	Wating_MSG, 
}MainSTATE;   	

typedef enum{ 
	PlcIdel = 0,
	PlcIntial,   
	PlcSendByte,   
	PlcSendEndFrame,   
	PlcSendFinishCheck,
	PLCSendSuccess,
	PlcSendFailed,
}PlcSendingState;  	


typedef enum{ 
	Plc_Idel = 0,
	Plc_Initial,
	Plc_Send_RTS,   
	Plc_Waiting_CTS,
	Plc_Received_CTS,   
	Plc_Send_Msg, 
	Plc_Send_Success,
	Plc_Send_Failed,
}PlcSendMsgState;  	

/*
typedef enum{ 
	Plc_RTS = 0x05,   
	Plc_CTS = 0x06,
	Plc_Receiving_Msg, 
}PlcReceiveMsgState; 
*/
typedef enum{ 
	NoMsg = 0,
	ReceivingMsg,   
	MsgReady,
}PlcMsgState;  	

enum MsgType{   
	BROARDCAST = 0x01,
	BEAT = 0x02,

	RequestToSend = 0x05,
	ClearToSend = 0x06,

	DATA = 0x09  
};

typedef struct 
{  
	char length;
	char *msg; 
}MSG; 
   

#endif